package view;

import models.HoursTableModel;
import org.joda.time.DateTime;
import table_objects.DzienPracy;

import javax.swing.*;
import javax.swing.table.TableModel;
import java.awt.*;
import java.io.*;
import java.util.ArrayList;

/**
 * Autor: Daniel Michalski
 * Data: 18.06.13
 */

public class SrodkowyPanel extends JPanel {

    private JTable tabela;
    private JButton usunBtn;

    public SrodkowyPanel(){
        ustawPanel();
        ustawKomponenty();
    }

    private void ustawPanel() {
        setLayout(new BorderLayout());
        setBackground(Color.BLACK);
    }

    private void ustawKomponenty() {
        tabela = new JTable();
        tabela.setSelectionBackground(Color.CYAN);
        tabela.setSelectionForeground(Color.BLACK);
        JScrollPane pane = new JScrollPane(tabela);
        pane.getViewport().setBackground(Color.BLACK);
        JPanel rightBtnPanel = new JPanel();
        rightBtnPanel.setBackground(Color.BLACK);
        rightBtnPanel.setLayout(new BoxLayout(rightBtnPanel, BoxLayout.X_AXIS));
        usunBtn = new JButton("Usuń");
        rightBtnPanel.add(usunBtn);

        add(pane, BorderLayout.CENTER);
        add(rightBtnPanel, BorderLayout.EAST);
    }

    public JTable getTabela() {
        return tabela;
    }

    public JButton getUsunBtn() {
        return usunBtn;
    }
}
